}
static void
-gdk_broadway_surface_input_shape_combine_region (GdkSurface *surface,
- const cairo_region_t *shape_region,
- gint offset_x,
- gint offset_y)
+gdk_broadway_surface_set_input_region (GdkSurface *surface,
+ cairo_region_t *shape_region)
{
}
impl_class->get_geometry = gdk_broadway_surface_get_geometry;
impl_class->get_root_coords = gdk_broadway_surface_get_root_coords;
impl_class->get_device_state = gdk_broadway_surface_get_device_state;
- impl_class->input_shape_combine_region = gdk_broadway_surface_input_shape_combine_region;
+ impl_class->set_input_region = gdk_broadway_surface_set_input_region;
impl_class->destroy = _gdk_broadway_surface_destroy;
impl_class->beep = gdk_broadway_surface_beep;
_gdk_surface_destroy (surface, FALSE);
}
- if (surface->input_shape)
- cairo_region_destroy (surface->input_shape);
+ if (surface->input_region)
+ cairo_region_destroy (surface->input_region);
if (surface->cursor)
g_object_unref (surface->cursor);
}
/**
- * gdk_surface_input_shape_combine_region:
+ * gdk_surface_set_input_region:
* @surface: a #GdkSurface
- * @shape_region: region of surface to be non-transparent
- * @offset_x: X position of @shape_region in @surface coordinates
- * @offset_y: Y position of @shape_region in @surface coordinates
+ * @region: region of surface to be reactive
*
* Apply the region to the surface for the purpose of event
* handling. Mouse events which happen while the pointer position
* function does nothing.
*/
void
-gdk_surface_input_shape_combine_region (GdkSurface *surface,
- const cairo_region_t *shape_region,
- gint offset_x,
- gint offset_y)
+gdk_surface_set_input_region (GdkSurface *surface,
+ cairo_region_t *region)
{
g_return_if_fail (GDK_IS_SURFACE (surface));
if (GDK_SURFACE_DESTROYED (surface))
return;
- if (surface->input_shape)
- cairo_region_destroy (surface->input_shape);
+ if (surface->input_region)
+ cairo_region_destroy (surface->input_region);
- if (shape_region)
- {
- surface->input_shape = cairo_region_copy (shape_region);
- cairo_region_translate (surface->input_shape, offset_x, offset_y);
- }
+ if (region)
+ surface->input_region = cairo_region_copy (region);
else
- surface->input_shape = NULL;
+ surface->input_region = NULL;
- GDK_SURFACE_GET_CLASS (surface)->input_shape_combine_region (surface, surface->input_shape, 0, 0);
+ GDK_SURFACE_GET_CLASS (surface)->set_input_region (surface, surface->input_region);
}
/**
gboolean focus_on_map);
GDK_AVAILABLE_IN_ALL
-void gdk_surface_input_shape_combine_region (GdkSurface *surface,
- const cairo_region_t *shape_region,
- gint offset_x,
- gint offset_y);
+void gdk_surface_set_input_region (GdkSurface *surface,
+ cairo_region_t *region);
GDK_AVAILABLE_IN_ALL
gboolean gdk_surface_is_viewable (GdkSurface *surface);
GdkCursor *cursor;
GHashTable *device_cursor;
- cairo_region_t *input_shape;
+ cairo_region_t *input_region;
GList *devices_inside;
gdouble *y,
GdkModifierType *mask);
- void (* input_shape_combine_region) (GdkSurface *surface,
- const cairo_region_t *shape_region,
- gint offset_x,
- gint offset_y);
+ void (* set_input_region) (GdkSurface *surface,
+ cairo_region_t *shape_region);
/* Called to do the windowing system specific part of gdk_surface_destroy(),
*
}
static void
-gdk_wayland_surface_input_shape_combine_region (GdkSurface *surface,
- const cairo_region_t *shape_region,
- gint offset_x,
- gint offset_y)
+gdk_wayland_surface_set_input_region (GdkSurface *surface,
+ cairo_region_t *input_region)
{
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
g_clear_pointer (&impl->input_region, cairo_region_destroy);
- if (shape_region)
- {
- impl->input_region = cairo_region_copy (shape_region);
- cairo_region_translate (impl->input_region, offset_x, offset_y);
- }
+ if (input_region)
+ impl->input_region = cairo_region_copy (input_region);
impl->input_region_dirty = TRUE;
}
impl_class->get_geometry = gdk_wayland_surface_get_geometry;
impl_class->get_root_coords = gdk_wayland_surface_get_root_coords;
impl_class->get_device_state = gdk_wayland_surface_get_device_state;
- impl_class->input_shape_combine_region = gdk_wayland_surface_input_shape_combine_region;
+ impl_class->set_input_region = gdk_wayland_surface_set_input_region;
impl_class->destroy = gdk_wayland_surface_destroy;
impl_class->beep = gdk_wayland_surface_beep;
}
static void
-gdk_win32_input_shape_combine_region (GdkSurface *window,
- const cairo_region_t *shape_region,
- gint offset_x,
- gint offset_y)
+gdk_win32_surface_set_input_region (GdkSurface *window,
+ cairo_region_t *input_region)
{
/* Partial input shape support is implemented by handling the
* NC_NCHITTEST message
impl_class->get_device_state = gdk_surface_win32_get_device_state;
impl_class->get_root_coords = gdk_win32_surface_get_root_coords;
- impl_class->input_shape_combine_region = gdk_win32_input_shape_combine_region;
+ impl_class->set_input_region = gdk_win32_surface_set_input_region;
impl_class->destroy = gdk_win32_surface_destroy;
//impl_class->beep = gdk_x11_surface_beep;
}
static void
-gdk_x11_surface_input_shape_combine_region (GdkSurface *surface,
- const cairo_region_t *shape_region,
- gint offset_x,
- gint offset_y)
+gdk_x11_surface_set_input_region (GdkSurface *surface,
+ cairo_region_t *input_region)
{
#ifdef ShapeInput
GdkX11Surface *impl = GDK_X11_SURFACE (surface);
if (!gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (surface)))
return;
- if (shape_region == NULL)
+ if (input_region == NULL)
{
XShapeCombineMask (GDK_SURFACE_XDISPLAY (surface),
GDK_SURFACE_XID (surface),
gint n_rects = 0;
XRectangle *xrects = NULL;
- _gdk_x11_region_get_xrectangles (shape_region,
+ _gdk_x11_region_get_xrectangles (input_region,
0, 0, impl->surface_scale,
&xrects, &n_rects);
XShapeCombineRectangles (GDK_SURFACE_XDISPLAY (surface),
GDK_SURFACE_XID (surface),
ShapeInput,
- offset_x * impl->surface_scale,
- offset_y * impl->surface_scale,
+ 0, 0,
xrects, n_rects,
ShapeSet,
YXBanded);
impl_class->get_geometry = gdk_x11_surface_get_geometry;
impl_class->get_root_coords = gdk_x11_surface_get_root_coords;
impl_class->get_device_state = gdk_x11_surface_get_device_state;
- impl_class->input_shape_combine_region = gdk_x11_surface_input_shape_combine_region;
+ impl_class->set_input_region = gdk_x11_surface_set_input_region;
impl_class->destroy = gdk_x11_surface_destroy;
impl_class->beep = gdk_x11_surface_beep;
region = gdk_cairo_region_create_from_surface (cairo_surface);
cairo_surface_destroy (cairo_surface);
- gdk_surface_input_shape_combine_region (priv->surface, region, 0, 0);
+ gdk_surface_set_input_region (priv->surface, region);
cairo_region_destroy (region);
}
else
- gdk_surface_input_shape_combine_region (priv->surface, NULL, 0, 0);
+ gdk_surface_set_input_region (priv->surface, NULL);
}
static gint
if (priv->extra_input_region)
cairo_region_intersect (region, priv->extra_input_region);
- gdk_surface_input_shape_combine_region (priv->surface, region, 0, 0);
+ gdk_surface_set_input_region (priv->surface, region);
cairo_region_destroy (region);
}
}